import request from '@/utils/request'

export function getProjectList(params) {  // 根据Id获取子项目数据接口
  return request({
    url: '/project/list',
    method: 'get',
    params
  })
}

export function getDeviceList(params) { //根据验证类型获取对应的设备列表
  return request({
    url: '/project/devicelist',
    method: 'get',
    params
  })
}

export function getProjectData(params) { // 根据Id获取子项目数据接口
  return request({
    url: '/project',
    method: 'get',
    params
  })
}

export function createProject(params) {  //新增子项目接口
  return request({
    url: '/project/insert',
    method: 'post',
    data: params
  })
}

export function updateProject(params) {  
  return request({
    url: '/project/update',
    method: 'post',
    data: params
  })
}
export function updateProjectState(params) {  
  return request({
    url: '/project/updatestate',
    method: 'post',
    data: params
  })
}
export function deleteProject(params) {
  return request({
    url: '/project/delete',
    method: 'post',
    data: params
  })
}

export function deletePic(params) {
  return request({
    url: '/project/pic/delete',
    method: 'post',
    params
  })
}

export function getGeneratePlan(params) {  //根据Id生成word文档数据接口
  return request({
    url: '/project/generateplan',
    method: 'get',
    params
  })
}

export function generateReport(params) {  // 通知phantomjs生成报告word文档的接口
  return request({
    url: '/project/startgeneratereport',
    method: 'get',
    params
  });
}

export function getGenerateStatus(params) {  //   根据子项目ID查询当前子项目的报告导出状态
  return request({
    url: '/project/generatestatus',
    method: 'get',
    params
  });
}

export function getGenerateFile(params) {  //   根据子项目ID查询当前子项目的报告导出地址
  return request({
    url: '/project/generatefileurl',
    method: 'get',
    params
  });
}

export function resetGenerateStatus(params) {  //   根据子项目ID重置当前子项目的报告导出状态
  return request({
    url: '/project/generatestatus',
    method: 'post',
    params
  });
}



